<template>
	<view class="formula-pages">
		<CustomNav :isBack="true" :topBgColor="topBgColor" title="详情"></CustomNav>
		<image src="@/static/image/home/bg.png" class="bg-img"></image>
		<view class="info-block" :style="'margin-top:'+mt">
			<view class="news-title">{{info.title}}</view>
			<view class="news-item">
				<view class="news-info">
					<view class="iconfont icon-shijian" style="font-size: 26rpx;"></view>
					<view class="news-text">{{info.createTime}}</view>
				</view>
				<view class="news-info" style="margin-left: 40rpx;" v-if="info.viewCount">
					<view class="iconfont icon-yanjing_xianshi_o" style="font-size: 40rpx;"></view>
					<view class="news-text">{{info.viewCount}}</view>
				</view>
			</view>
			<mp-html :content="info.content"></mp-html>
		</view>
	</view>
</template>

<script>
	import {
		getArticleDetailApi
	} from '@/api/home.js'
	export default {
		components: {

		},
		data() {
			return {
				info: {},
			}
		},
		methods: {
			getArticleDetail() {
				getArticleDetailApi({
					id: this.id,
				}).then(res => {
					this.info = res
				})
			},
		},
		onLoad(e) {
			this.id = e.id;
			this.getArticleDetail();
		}
	}
</script>

<style lang="scss" scoped>
	.formula-pages {
		overflow: hidden;
		min-height: 100vh;
		background-color: #F8FBFF;

		.bg-img {
			width: 100%;
			height: 100%;
			position: absolute;
		}

		.info-block {
			position: relative;
			padding: 30rpx;
			background-color: #ffF;
			min-height: 80vh;

			.news-title {
				font-size: 34rpx;
				margin-bottom: 30rpx;
				font-weight: bold;
			}

			.news-item {
				display: flex;
				align-items: center;

				.news-info {
					display: flex;
					align-items: center;
					font-size: 28rpx;
					color: #767676;

					.iconfont {
						margin-right: 10rpx;
					}
				}
			}
		}
	}
</style>